//注入一个page页面
Page({
  //写page对象的属性值和方法
  data:{

    name:"牛牛",
    student:['张三','李四','王五'],
    index:0,
    banner:[],
    navTopItems: [],
    // 列表内容的下标静态的时候使用
    curIndex:0,
    // 导航栏列表内容数据
    navSection: [],
    colors:["red","orange","yellow","green","purple"],
    indicatorDots: true,
    vertical:false,
    autoplay:true,
    interval:3000,
    duration:1000,
    // 选中id
    curNavId:1
  },
  onLoad:function(options){
    var that=this;
    wx.request({
      url: 'http://localhost:8080/pic/queryByType/lb',
      success:function(result){
        console.log(result)
         that.setData({
           banner:result.data.data
         })
      }
    })
    //向服务器获取导航栏数据
  wx.request({
    url: 'http://localhost:8080/pic/queryByType/nav',
    success:function(res){
      // console.log(res)
      that.setData({
      navTopItems:res.data.data
      })
    }
  })
  },
  
  changePage:function(event){
    var id = event.currentTarget.dataset.id
    wx.navigateTo({ 
      url:"../hot/hot?suId"+id,
   })

  }

})
